﻿using Microsoft.Extensions.DependencyInjection;
using Serilog;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace WpfMvvmTemplate.HC.Common
{
    public class GlobalStaticData
    {
        //绑定静态属性时，需要实现INotifyPropertyChanged接口
        public static event EventHandler<PropertyChangedEventArgs>? StaticPropertyChanged;

        private static string assemblyVersion = "V1.00.000.000.001";

        //程序软件版本
        public static string AssemblyVersion
        {
            get { return assemblyVersion; }
            set
            {
                assemblyVersion = value;
                StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs("AssemblyVersion"));
            }
        }

        //语言编号：0-中文；1-英文
        public static int LanguageNum { get; set; } = 0;

        // 中英文对应的值字典
        public static Dictionary<string, string> LanguageDic { get; set; } = new();

        //配置文件AppSettings.json文件路径
        public static string AppSettingsFilePath { get; set; } = AppDomain.CurrentDomain.BaseDirectory + "AppSettings.json";

        //日志
        public static ILogger Logger { get; set; } = App.Current.Services.GetService<ILogger>()!;
    }
}